home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b2.d64
/
exhibitoptions
< prev
next >
Wrap
Text File
|
2007-02-28
|
3KB
|
107 lines
0010 //PROGRAM: EXHIBITOPTIONS//
0020 DIM NAME$(15) OF 20, OPTION(15,4)
0030 DIM SUBJECT$(4) OF 12, N$ OF 20, A$ OF 3
0040 DIM SPACES$ OF 39
0050 //
0060 SPACES$(1:39):=""
0070 SUBJECT$(1):="BIOLOGY"
0080 SUBJECT$(2):="GERMAN"
0090 SUBJECT$(3):="INFORMATICS"
0100 SUBJECT$(4):="MUSIC"
0110 //
0120 STARTPROGRAM
0130 REPEAT
0140 PRINT CHR$(147) //CLEAR
0150 WINDOW(8,15)
0160 PRINT "1 = A STUDENT'S OPTIONS"
0170 PRINT "2 = DISTRIBUTION OF SUBJECTS"
0180 PRINT "3 = STOP PROGRAM"
0190 PRINT
0200 INPUT "ENTER JOB: ": JOB
0210 //
0220 IF JOB=1 THEN OPTIONS
0230 IF JOB=2 THEN DISTRIBUTION
0240 IF JOB=3 THEN STOP
0250 UNTIL FALSE
0260 //
0270 PROC OPTIONS
0280 WINDOW(8,20)
0290 INPUT "STUDENT'S NAME: ": N$
0300 I:=0; FOUND:=FALSE
0310 WHILE NOT (FOUND OR I=MAX) DO
0320 I:=I+1
0330 FOUND:=(N$=NAME$(I))
0340 ENDWHILE
0350 IF FOUND THEN
0360 PRINT
0370 PRINT N$,"'S OPTION:"
0380 PRINT
0390 FOR J:=1 TO 4 DO
0400 IF NOT OPTION(I,J)=-1 THEN
0410 PRINT SUBJECT$(J),TAB(15),"AT LEVEL ",OPTION(I,J)
0420 ENDIF
0430 ENDFOR J
0440 WINDOW(18,18)
0450 INPUT "PRESS RETURN TO CONT. ": A$
0460 ELSE
0470 WINDOW(1,1)
0480 PRINT "NO STUDENT WITH THAT NAME"
0490 INPUT "DO YOU WANT A LIST (Y/N)? ": A$
0500 IF A$="Y" THEN DISPLAY
0510 ENDIF
0520 ENDPROC OPTIONS
0530 //
0540 PROC DISTRIBUTION
0550 REPEAT
0560 WINDOW(8,15)
0570 INPUT "ENTER SUBJECT: ": N$
0580 I:=0; OK:=FALSE
0590 WHILE NOT OK AND I<4 DO
0600 I:=I+1
0610 OK:=(N$=SUBJECT$(I))
0620 ENDWHILE
0630 UNTIL OK
0640 REPEAT
0650 INPUT "ENTER LEVEL: ": LEVEL
0660 UNTIL LEVEL=1 OR LEVEL=2
0670 PRINT CHR$(147) //CLEAR
0680 PRINT "THE FOLLOWING STUDENTS TAKE"
0690 PRINT N$," AT LEVEL ",LEVEL,":"
0700 PRINT
0710 FOR STNO:=1 TO MAX DO
0720 IF OPTION(STNO,I)=LEVEL THEN PRINT NAME$(STNO)
0730 ENDFOR STNO
0740 WINDOW(18,18)
0750 INPUT "PRESS RETURN TO CONT. ": A$
0760 ENDPROC DISTRIBUTION
0770 //
0780 PROC DISPLAY
0790 PRINT CHR$(147) //CLEAR
0800 FOR STNO:=1 TO MAX DO PRINT NAME$(STNO)
0810 WINDOW(18,18)
0820 INPUT "PRESS RETURN TO CONT. ": A$
0830 ENDPROC DISPLAY
0840 //
0850 PROC STARTPROGRAM
0860 OPEN FILE 2,"OPTIONS",READ
0870 READ FILE 2: MAX
0880 FOR I:=1 TO MAX DO
0890 READ FILE 2: NAME$(I)
0900 FOR J:=1 TO 4 DO READ FILE 2: OPTION(I,J)
0910 ENDFOR I
0920 CLOSE
0930 ENDPROC STARTPROGRAM
0940 //
0950 PROC WINDOW(X,Y)
0970 SCREEN(X,1)
0980 FOR I:=1 TO Y-X+1 DO PRINT SPACES$
0990 SCREEN(X,1)
1000 ENDPROC WINDOW
1010 //
1020 PROC SCREEN(ROW,COL) CLOSED
1030 PRINT CHR$(19), //HOME
1040 FOR I:=1 TO ROW DO PRINT //DOWN
1050 FOR I:=1 TO COL-1 DO PRINT CHR$(29), //RIGHT
1060 ENDPROC SCREEN
1070 //